/**
 * 
 */

$(function(){
	
	function checkUsername(){
		var usercode = $("#Username");
		var flag = true;
		if(usercode.val() == ''){
			usercode.next().html("请输入账号！");
			flag = false;
		}
		return flag;
	}
	
	function checkPassword(){
		var Password = $("#Password");
		var flag = true;
		if(Password.val() == ''){
			Password.next().html("请输入密码！");
			flag = false;
		}
		return flag;
	}
	
	
	$("#Username").bind({"blur":function(){
		$(this).next().html("*");
		
	},"focus":function(){
		
		checkUsername();
	}})
	
	
	$("#Password").bind({"blur":function(){
		$(this).next().html("*");
		
	},"focus":function(){
		checkPassword();
	}})
	
	
	$("#submit").click(function(){
		var flag = true;
		if(!checkPassword()){
			flag = false;
		}
		
		if(!checkUsername()){
			flag = false;
		}
		
		if(flag){
			$("#loginForm").submit();
		}
		
		
	});
	
	
})

